package pl.vm.domain;

import java.util.Comparator;
import java.util.Map;

public class ValueComparator implements Comparator<VirtualTeam> {
	
	private Map<VirtualTeam, Double> base;

	public ValueComparator(Map<VirtualTeam, Double> base) {
		this.base = base;
	}

	@Override
	public int compare(VirtualTeam o1, VirtualTeam o2) {
		double value1 = base.get(o1);
		double value2 = base.get(o2);
		return value1 < value2 ? -1 : value1 > value2 ? 1 :0; 
	}
}
